//
//  ViewController.m
//  03-UIResponder-封装button
//
//  Created by 王道林 on 16/7/18.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "ViewController.h"
#import "LableOfB.h"
#import "ImageViewOfEvev.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
//    通过UILabel封装实现只显示文字的Button
//    通过UIImageView封装实现只显示图片的Button
    LableOfB *lableB = [[LableOfB alloc] initWithFrame:CGRectMake(0, 0, 100, 100) name:@"点我啊" target:self action:@selector(lableOfButtonEven:)];
    lableB.backgroundColor = [UIColor redColor];
    [self.view addSubview:lableB];
    
    ImageViewOfEvev *imageView = [[ImageViewOfEvev alloc] initWithFrame:CGRectMake(200, 200, 100, 200) imageName:@"11.jpg" target:self action:@selector(imageViewTouch:)];
    [self.view addSubview:imageView];
    
    
}

- (void)lableOfButtonEven:(LableOfB *)lable
{
    NSLog(@"敢点我");
}

- (void)imageViewTouch:(ImageViewOfEvev *)imageview
{
    NSLog(@"点图片了");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
